<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
</head>
<body><form action="logincheck.java" method="post">
    密码:<input type="password" name="password"><br>
    验证码:<input type="text" name="userCode" maxlength="4">
    <img src="validatecode.java" height="30" width="100" id="validateCodeImg" alt=""><br>
    <input type="submit" value="登录"><br>
</form>
<script type="text/javascript">
    const img = document.getElementById("validateCodeImg");
    img.onclick=function () {
        img.src="ValidateCodeServlet?m="+Math.random();
    }
</script>

</body>
</html>